﻿/*  
 *  新手出生地：910142200
 *  QQ12796161 
 */


var status = 0;
var z = "#fMap/MapHelper.img/weather/guildBless/3#";//"+z+"//美化
var a = "#fMap/MapHelper.img/weather/lovelypartybear/7#";
var zz = "#fMap/MapHelper.img/weather/knitsWithWarmWinter/4#";

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
            cm.dispose();
			openNpc(9900000);
        } 
    else if (status == 0) { //
		var selStr = "- #e#dXX冒险岛欢迎您：#n#k\r\n\r\n#b本服经验 30 倍、金币 10 倍、爆率 10 倍。元宝均可以通过BOSS掉落。小怪几率掉落各种魔方碎片。新手上线免费赠送理财VIP盒子。\r\n"
		selStr += "#r#L0#"+z+" 任务一：#b领取新手首次奖励。#l\r\n";
		//selStr += "#r#L1#"+z+" 任务二：#b查收道具以及使用。#l\r\n\r\n";
		selStr += "#e#d#L2#"+zz+" 直接离开此处#r[无奖励谨慎操作]。#n#l\r\n";
		cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
        case 1: // 自由市场
           if (cm.haveItem(2430865, 1)) {
                    cm.sendOk("#r请双击使用背包里的 #i2431091# #t2431091#。");
                } else {
                    cm.sendOk("#b您确定您完成了任务一了吗？或者您其他的角色已经领取过了？");
                }
                cm.dispose();
                break;
		case 2: // 快速转职
			cm.dispose();
			cm.warp(910142210);
			break;
		case 0: // 快速转职
			if (cm.getEventCount("新手奖励", 1) == 0){
				cm.gainItem(2430865, 1);
				cm.gainItem(1142742, 1, 1);
				cm.gainItem(1113020, 1, 1);
				cm.gainItem(5010126, 1, 3);
				cm.gainItem(3015314, 1, 1);
				cm.gainItem(2430241, 1);
				cm.gainItem(5150040, 100);// 皇家理发
				cm.gainItem(5152053, 100);// 皇家整容
				cm.gainItem(5150052, 10);// 万能高级美发
				cm.gainItem(5153015, 10);// 万能护肤
				cm.gainItem(5152057, 10);// 万能高级整形
				cm.setEventCount("新手奖励", 1);
				cm.warp(910142210);
				cm.dispose();
			} else {
			cm.gainItem(2431549, 1);
			cm.gainItem(2430241, 1);
			cm.warp(910142210);
			cm.dispose();
			//cm.openNpc(9300011);
			break;
			}
         }
    }
}